package tcc;

import java.util.List;

import tcc.model.colony.Colony;
import tcc.model.dao.ProdutoDao;
import tcc.model.entities.ProdutoEntity;
import tcc.model.graph.Vertex;
import tcc.resources.SerialCommunicator;
import tcc.view.graph.GraphDisplay;

/**
 * 
 * @author Gabriel Pacheco
 *
 */
public class MainSmartMarket {

	public static void main(String [] args) {
		//SerialCommunicator sc = new SerialCommunicator();
		
		long x = System.currentTimeMillis();
		Colony colony = new Colony();
		int option;
		String route = "";
		
		GraphDisplay gd = new GraphDisplay(colony); //REMOVER
		
		Vertex actualVertex = colony.getGraph().getVertex().get(22).getVertex(); //REMOVER - TEMPORARIO
		
		option = 1;
		
		//Adicionar 2 loops, um geral e outro para leitura
		
		/**
		 * case 1: route from entrance to all goals
		 * case 2: route from actual position to cashier
		 * case 3: product description
		 */
		switch(option) {
		case 1: route = colony.antStart(colony.fromList, colony.getGraph().getEntranceVertex());
				System.out.println(route); //REMOVER
				System.out.println("Distancia " + colony.getBestRouteDistance()); //REMOVER
				gd.drawGraph(); //REMOVER
			break;
		case 2: route = colony.antStart(colony.toCashier, actualVertex);
				System.out.println(route); //REMOVER
				System.out.println("Distancia " + colony.getBestRouteDistance()); //REMOVER
				gd.drawGraph(); //REMOVER
			break;
		case 3: ProdutoDao pd = new ProdutoDao(); 
				List<ProdutoEntity> lista = pd.getProdutoInfo("1");
				
				for(ProdutoEntity pe : lista) {
					System.out.println(pe.toString());
				}
			break;
		}

		System.out.println(System.currentTimeMillis() - x);
	}
}
